package top.eggcode.base;
import top.eggcode.component.session.SessionHelper;


/**
 * Title: 基础会话接口类
 * Description: TODO
 * Date: 2021/4/10 8:55
 *
 * @author JiaQi Ding
 * @version 1.0
 */
public abstract class SessionBaseController extends PackBaseController {

    protected String getUsername() {
        Object username = SessionHelper.getSession().getAttribute("principal");
        if (username != null) {
            return username.toString();
        }
        return "#visitor";
    }
}
